import http from '../utils/axios';
import { Finance } from '@/interface/index';
interface DataType {
  categoryCreated: string;
  categoryId: number;
  categoryImg: string;
  categoryMsg: string;
  categoryName: string;
  categoryNumber: number;
  categoryParent: number;
  categoryRec: string;
  categorySort: string;
  categoryStatus: string;
}

export const getOrderApi = (time: string) =>
  http.post<Finance.Order>('/other/home/finance/getOrder', time);

export const getVipApi = (time: string) =>
  http.post<Finance.Vip>('/other/home/finance/getVip', time);

//获取父级分类
export const getClassUp = () =>
  http.get<DataType[]>('/other/shopping/category/getParentList');

//删除
export const deleteCate = (params: any) =>
  http.get<DataType[]>('/other/shopping/category/deleteCateId', params);

//获取子级分类
export const getClassDown = () =>
  http.get<DataType[]>('/other/shopping/category/getList');

//审核页面查询
export const getListFindByCon = (params: {}) =>
  http.post<any>('/other/shopping/goods/getListFindByCon', params);

// 查询商品评价
export const getListEva = (params: {}) =>
  http.post<any>('/other/shopping/appraise/findByAppraise', params);
// 全查类别
export const getAllcate = () =>
  http.get<any>('/other/shopping/category/findAll');

// 获取品牌列表
export const getbrandName = () =>
  http.get<any>('/other/shopping/brand/getList');

//查询
export const auditselect = (params: {}) =>
  http.post<any>('/other/shopping/goods/getListFindByCon', params);

//传属性进行操作
export const deleteAllcheck = (params?: {}) =>
  http.post<any>('/other/shopping/goods/updateStatus', params);

//排序
export const sortxiekun = (params?: {}) =>
  http.post<any>('/other/shopping/goods/getListFindByCon', params);

//上架下架
export const chabgeDiy = (params?: {}) =>
  http.post<any>('/other/shopping/category/updateCate', params);

// export const getOrderApi = (time: string) =>
//   http.post<Finance.Order>('/home/finance/getOrder', time);

// export const getVipApi = (time: string) =>
//   http.post<Finance.Vip>('/home/finance/getVip', time);

export const getFinanceApi = (data = {}) =>
  http.post<Finance.FinanceData>('/other/finance/getFinance', data);
